//
//  DegreeView.m
//  SecondPage
//
//  Created by winston on 13-4-24.
//  Copyright (c) 2013年 winston. All rights reserved.
//

#import "DegreeView.h"

#define MarinLeft 30

@implementation DegreeView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        bgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        [bgView setImage:[UIImage imageNamed:@"AllAuto_Image_Navigate.png"]];
        [self addSubview:bgView];
        [bgView release];
    
        dotView = [[UIImageView alloc]initWithFrame:CGRectMake(-1000,self.frame.size.height/2-13.0/2,12,13)];
        [dotView setImage:[UIImage imageNamed:@"AllAuto_Image_Degree.png"]];
        [self addSubview:dotView];
        [dotView release];
    }
    return self;
}

-(void)selectIndex:(NSInteger)index withTotal:(NSInteger)total
{
    CGPoint point = CGPointMake(MarinLeft+ (self.frame.size.width-2*MarinLeft)*index/total, self.frame.size.height/2-1);
    [dotView setCenter:point];
}
@end
